package entity;

public abstract class Field {
	
	protected String title, subtitle, description; 
	protected int consequence;
	
	public Field(String title, String subtitle, String desc, int cnsq){
		this.title=title;
		this.subtitle=subtitle;
		this.description=desc;
		this.consequence=cnsq;
	}
	
	public abstract void landOnField(Spiller spiller);
	
	public abstract desktop_fields.Field createGuiField();
	
	/**
	 * Returnerer beskrivelsen for feltet.
	 */
	public String getDesc(){
		return description;
	}
	
	public int getConsequence(){
		return consequence;
	}
	
	/**
	 * Udksriver feltets titel samt konsekvens ved at lande på feltet (Hvis feltet er af typen Ownable gåes der ud fra feltet har en ejer).
	 */
	public String toString(){
		String output = title;
		if (output.length() > 8){
			output = output.substring(0, 8)+"..";
			return output + "\t : " + String.valueOf(consequence);
		}
		else if (output.length() == 8){
			return output + "\t : " + String.valueOf(consequence);
		}
		else{
			return output + "\t\t : " + String.valueOf(consequence);
		}	
	}
}
